<template>
	<view class="container">
		<view class="container-bg">
			<view class="headBg">
			</view>
			<view class="head">
				<image @click="backPage()" class="fanhuiIma"
					src="https://images.linglinggong.net/static/icon1/fanhui.png" mode="aspectFill"></image>
				<text>确认任务</text>
			</view>
			<view class="taskInfo">
				<view class="taskInfo-tile">
					<view class="taskInfo-yellowBlock"></view>
					<text
						class="taskInfo-tile-text">{{task.name.length>=12?task.name.slice(0,12)+'...':task.name}}</text>
				</view>
				<view class="taskInfo-item">
					<view class="taskInfo-price">
						<view class="taskInfo-price-item">
							<view class="taskInfo-item-textDive1">
								<text class="taskInfo-item-text1">报酬方式</text>
								<text class="taskInfo-item-text1">任务工价</text>
							</view>
							<view class="taskInfo-item-textDive1">
								<text class="taskInfo-item-text2">{{task.taskType==0 ? '计时':'计件'}}</text>
								<text class="taskInfo-item-text2">{{task.reward}}&nbsp;元/小时</text>
							</view>
						</view>
					</view>
					<view class="taskInfo-time">
						<view class="taskInfo-time-item">
							<view class="taskInfo-item-textDive1">
								<text class="taskInfo-item-text1">任务日期</text>
								<text class="taskInfo-item-text1">用工性别</text>
							</view>
							<view class="taskInfo-item-textDive2">
								<text class="taskInfo-item-text2">{{getShowDate()}}</text>
								<text
									class="taskInfo-item-text2">{{ task.sex == 0 ? '男' :  task.sex == 1 ? '女' : '不限'}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class="taskInfo-people">
					<view class="maskRemove" :style="{'z-index': isfirst==0?'52':''}">
						<view class="maskRemoveLife_text">
							<text class="taskInfo-item-text1">任务时间</text>
						</view>
						<view class="maskRemoveLife_text2">
							<!-- <timeSelect :timeTextColor="'#000000'" :startTaskTime="task.startTime"
								:endTaskTime="task.endTime" @starTime="starTime" @endTime="endTime"
								:timeFlag="timeFlag"></timeSelect> -->
							<text v-if="task.startTime" @click="isShowTimeSelect=true"
								class="taskInfo-item-text2">{{task.startTime.split(' ')[1].slice(0,5)}}<text
									style="margin: 0 10rpx;">—</text>{{isTaskTomorrowFlag?'次日':''}}{{task.endTime.split(' ')[1].slice(0,5)}}</text>
						</view>
						<view class="maskRemove-indicator" v-if="isfirst==0" @click="showFirst">
							<view class="maskRemove-indicator-sj"></view>
							<view class="maskRemove-indicator-block">这里可进行时间调整</view>
						</view>
					</view>
					<view class="maskRemove" :style="{'z-index': isfirst==1?'52':''}">
						<view class="maskRemoveRight_text">
							<view class="yk_count" v-if="ykName!='0'&&isLevelsd!=2"
								@click="ykCount<task.number?goToBuyJiayou():''">
								{{ykCount>=task.number?ykName+ykCount+'次':'剩余人数已不足>'}}
							</view>
							<view class="yk_count_sj" v-if="ykName!='0'&&isLevelsd!=2"></view><text
								class="taskInfo-item-text1">用工人数</text>
						</view>
						<view class="maskRemoveRight_text2">
							<view class="renshu">
								<image v-show="task.number!=1" src="https://images.linglinggong.net/static/icon1/-.png"
									mode="aspectFill" @click="addNumber(false)"></image>
								<image v-show="task.number==1"
									src="https://images.linglinggong.net/static/icon1/-no.png" mode="aspectFill">
								</image>
								<input v-model="task.number" maxlength="2" type="number" @input="inputNumber()">
								<!-- <text>{{task.number}}</text> -->
								<image src="https://images.linglinggong.net/static/icon1/+.png" mode="aspectFill"
									@click.stop="addNumber(true)">
								</image>
							</view>
							<view class="maskRemove-indicator" v-if="isfirst==1" @click.stop="showFirst">
								<view class="maskRemove-indicator-sj"></view>
								<view class="maskRemove-indicator-block">这里可进行人数调整</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="taskAdd">
				<text class="taskAddInfo">
					{{task.address.split('·').join(' ')}}
				</text>
			</view>
			<view class="taskInfoPs" v-if="task.taskVideo||pictureList.length!=0||task.taskContent">
				<view class="taskInfoPs-text">
					<text>{{this.task.taskContent}}</text>
					<view class="taskInfoPs-picture-div">
						<view v-for="(picture, index) in pictureList" :key="index">
							<image class="taskInfoPs-picture" :src="imgPath + picture" mode="aspectFill"></image>
						</view>
						<view v-if="task.taskVideo">
							<view class="taskInfoPs-video" @click="playFull()">
								<image class="taskInfoPs-video-playIcon"
									src="https://images.linglinggong.net/static/icon1/playVideo.png" mode="aspectFill">
								</image>
							</view>
							<video v-show="isShowVideo" id="playFull" class="taskInfoPs-picture"
								:src="imgPath + task.taskVideo" @play="playFull()"
								@fullscreenchange="fullscreen($event)"></video>
						</view>
					</view>
				</view>
			</view>
			<view class="miandarao">
				<view class="miandarao-info">
					<text>设置任务免打扰</text>
					<text>雇员接单时,将不会电话沟通,直接上门服务</text>
				</view>
				<view class="miandarao-button" :class="task.disturbstatus==1?'miandarao-button-selected':''"
					@click="task.disturbstatus=task.disturbstatus==0?1:0">
					<view class="miandarao-button-switch"></view>
				</view>
			</view>
			<view class="youxian-content" v-if="isOpenYouxian">
				<view class="youxian">
					<view v-show="!isYouxian" class="radio" @click="isYouxian = true">
					</view>
					<image v-show="isYouxian" @click="isYouxian = false"
						src="https://images.linglinggong.net/static/newMy/radio.png" mode=""></image>
					<text>优先推送给我收藏与好评过的零工</text>
				</view>
				<view class="sanjiao" v-if="isQipao">
				</view>
				<view class="youxian-qipao" v-if="isQipao" @click="isQipao=false"> 优先通知您的收藏零工接单 </view>
			</view>
			<view class="bottomButton">
				<view class="bottomButton1" @click="isShowMoreButton=true">编辑</view>
				<view :class="timeError?'bottomButton3':'bottomButton2'" @click="!timeError?fabu():''">发布</view>
			</view>
		</view>
		<showModalButton v-show="isShowModalButton" :modalText1="'如放弃发布，'" :modalText2="'已被邀请的雇员将会失效'"
			:buttonLeftText="'确认取消'" :buttonRightText="'继续发布'" :modalTextSize="'32rpx'" :modalTextHeight="'49rpx'"
			@clickLeft="backPage(),isShowModalButton=false" @clickRight="isShowModalButton=false,BackPress=true">
		</showModalButton>
		<showModalButton v-show="isShowMoreButton" :modalTextColor="'#787878'" :modalText1="'你需要编辑更多内容吗？'"
			:modalText2="' '" :buttonLeftText="'需要'" :buttonRightText="'取消'" :modalTextSize="'32rpx'"
			:modalTextHeight="'49rpx'" :rightButtonColor="'#FE4B28'" @clickLeft="redact(),isShowMoreButton=false"
			@clickRight="isShowMoreButton=false">
		</showModalButton>
		<jobPay v-if="isShowPay" :get-task-id="newTaskId" @closePayPage="isShowPay=false"></jobPay>
		<view class="maskFirst" @click.stop="showFirst" v-if="isfirst<2"></view>
		<timeSelect v-if="isShowTimeSelect" @close="isShowTimeSelect=false" :timeFlag="timeFlag"
			@getTaskTime="getTaskTime"></timeSelect>
	</view>
</template>
<script>
	import {
		isTaskTomorrow,
		getContacts
	} from '@/libs/unit.js'
	import md5 from '@/store/md5.js'
	import jobPay from '../app-employer/send-job-pay/send-job-pay-new.vue'
	// import timeSelect from '../../components/timeSelect/timeSelect.vue'
	import timeSelect from '../../components/time-select/time-select.vue'
	import showModalButton from '@/components/showModalButton/showModalButton.vue'
	export default {
		data() {
			return {
				taskId: 0, //任务id
				task: {
					address: '',
					lat: 0,
					res: 0,
					name: '',
					number: 1,
					region: 0,
					reward: 0,
					sex: '',
					taskContent: '',
					taskType: '',
					floorsAmount: 0,
					taskVideo: '',
					telephone: '',
					age: 0,
					startTime: '',
					endTime: '',
					floorsstr: 0,
					disturbstatus: 0,
				},
				pictureList: [],
				hasFlag: false,
				timeFlag: 0,
				timer: null,
				isSelect: [], //选中邀请的雇员的item
				imgPath: '',
				bond: '', //保证金
				isShowPay: false,
				md5flag: '',
				newTaskId: '', //发布任务的id
				isShowModalButton: false,
				BackPress: false, //不拦截返回
				isShowVideo: false,
				timeError: false,
				isShowMoreButton: false,
				isfirst: 0,
				pageType: -1, //功能监测---一键发布1任务中心发布/2历史发布3为完单邀请
				taskNum: 1, //用工人数
				wdfb: false,
				isShowTimeSelect: false,
				isTaskTomorrowFlag: false,
				ykCount: 0,
				ykName: '',
				isLevelsd: 0,
				isBtnClick: false,
				isQipao: false,
				isYouxian: false,
				isOpenYouxian: false
			}
		},
		components: {
			jobPay,
			timeSelect,
			showModalButton
		},
		// #ifdef APP-PLUS
		watch: {
			isShowTimeSelect() {
				this.isclosePullToRefresh(!this.isShowTimeSelect)
			},
		},
		// #endif
		methods: {
			qipao() {
				if (!uni.getStorageSync('confirmTaskQipao')) {
					this.isQipao = true
					let firstTime = new Date().getTime()
					let Endtime = firstTime + 6 * 30 * 24 * 60 * 60 * 1000
					uni.setStorageSync('confirmTaskQipao', Endtime)
					uni.setStorageSync('confirmTaskQipaoLastTime', firstTime)
				}
				let now = new Date().getTime();
				if (now > uni.getStorageSync('confirmTaskQipao')) {
					return
				} else {
					if (now - uni.getStorageSync('confirmTaskQipaoLastTime') > (30 * 24 * 60 * 60 * 1000)) {
						console.log(now - uni.getStorageSync('confirmTaskQipaoLastTime'))
						this.isQipao = true
						uni.setStorageSync('confirmTaskQipaoLastTime', now)
					}
				}
			},
			backPage() {
				if (this.BackPress) {
					this.isShowModalButton = !this.isShowModalButton
					this.BackPress = false
				} else {
					this.isShowModalButton = false
					uni.navigateBack({
						delta: 1
					})
				}
			},
			refresh() {
				this.getUserInfo()
				this.task_detail()
				this.hasFlag = true
				uni.stopPullDownRefresh()
			},
			//点击播放时全屏
			playFull() {
				let videoContext = uni.createVideoContext('playFull', this);
				videoContext.requestFullScreen();
			},
			//退出全屏时停止播放
			fullscreen(e) {
				if (!e.detail.fullScreen) {
					let videoContext = uni.createVideoContext('playFull', this);
					videoContext.pause()
					this.isShowVideo = false
				} else {
					this.isShowVideo = true
				}
			},
			//获取时间
			getDate(time) {
				time = time.split(' ')
				let d = new Date();
				d.setDate(d.getDate() + this.timeFlag)
				let year = d.getFullYear()
				let Month = (d.getMonth() + 1).toString()
				let day = d.getDate().toString()
				time[0] = year + '-' + (Month.length == 1 ? '0' + Month : Month) + '-' + (day.length == 1 ? '0' + day :
					day)
				return time.join(' ')
			},
			//获取显示时间
			getShowDate() {
				let d = new Date();
				d.setDate(d.getDate() + this.timeFlag)
				let Month = (d.getMonth() + 1).toString()
				let day = d.getDate().toString()
				return (Month.length == 1 ? '0' + Month : Month) + '-' + (day.length == 1 ? '0' + day : day) + ' ' + (this
					.timeFlag == 0 ? '今天' : '明天')
			},
			//判断今天任务时间是否合理
			isTaskDateRational(time) {
				if (this.timeFlag == 0) {
					let d = new Date();
					let Hours = parseInt(d.getHours())
					let Minutes = parseInt(d.getMinutes())
					let taskHours = parseInt(this.task.startTime.split(' ')[1].split(':')[0])
					let taskMinutes = parseInt(this.task.startTime.split(' ')[1].split(':')[1])
					let taskEndHours = parseInt(this.task.endTime.split(' ')[1].split(':')[0])
					let taskEndMinutes = parseInt(this.task.endTime.split(' ')[1].split(':')[1])
					if (taskHours < Hours && !this.isTaskTomorrowFlag) {
						this.timeError = true
						uni.showToast({
							title: '请更改任务时间',
							icon: 'none'
						})
					} else if (taskHours == Hours && taskMinutes < Minutes + 30) {
						this.timeError = true
						uni.showToast({
							title: '请更改任务时间',
							icon: 'none'
						})
					} else if (taskEndHours < taskHours && !this.isTaskTomorrowFlag) {
						this.timeError = true
						uni.showToast({
							title: '请更改任务时间',
							icon: 'none'
						})
					} else if (taskEndHours == taskHours && taskEndMinutes < taskMinutes + 30) {
						this.timeError = true
						uni.showToast({
							title: '请更改任务时间',
							icon: 'none'
						})
					} else {
						this.timeError = false
					}
				}
			},
			//邀请雇员接单
			async invitationOrder(users) {
				if (users.length == 0) {
					return
				} else {
					for (let i = 0; i < users.length; i++) {
						let res = await this.$fetch(this.$api.invitation_order, {
							taskId: this.newTaskId,
							userIds: users[i],
						}, 'POST')
						if (res.code) return uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				}
			},
			//获取邀请的雇员的信息
			getStaff(item) {
				this.isSelect = item
			},
			//设置邀请的雇员的缓存
			setStorageStaff() {
				if (this.isSelect.length != 0) {
					uni.setStorageSync('invitationStaff', this.isSelect)
				}
			},
			//发布任务
			async fabu() {
				if (this.isBtnClick) {
					return
				}
				this.isBtnClick = true
				setTimeout(() => {
					this.isBtnClick = false
				}, 4000)
				let upObj = {
					"address": this.task.address,
					"endTime": this.task.endTime,
					"lat": this.task.lat,
					"lng": this.task.lng,
					"name": this.task.name,
					"number": this.task.number,
					"region": this.task.region, //街道区域自己算
					"reward": this.task.reward.subtract(100),
					"sex": this.task.sex,
					"startTime": this.task.startTime,
					"taskContent": this.task.taskContent,
					"taskPic": this.task.taskPic,
					"taskType": this.task.taskType,
					floorsAmount: this.task.floorsAmount * 100,
					taskVideo: this.task.taskVideo,
					telephone: this.task.telephone,
					serverFlag: this.serverFlag,
					userName: this.md5flag,
					competitive: this.competitive,
					age: this.isSelectJobAge,
					floorsstr: this.task.floorsstr,
					disturbstatus: this.task.disturbstatus,
					priorityPushFlag: this.isYouxian ? 1 : 0
					// taskCateId:this.task.taskCateId,
					// taskCateName:this.task.taskCateName
				}
				// console.log(11,upObj);
				// return
				uni.showToast({
					title: '发布中~',
					icon: 'none'
				})
				if (this.wdfb) {
					console.log(upObj)
					upObj['sincerityGold'] = -1
				}
				let res = await this.$fetch(this.$api.release_task, upObj, 'POST', 'JSON')
				if (res.code) {
					if (res.msg == '未购买直通卡，请先购买~') {
						setTimeout(() => {
							uni.navigateTo({
								url: '/pages/bossMonthCard/straightCard'
							})
						}, 2000)
					}
					return uni.showToast({
						title: res.msg,
						icon: 'none'
					})
				}
				if (this.pageType != -1) {
					this.get_task_one(this.pageType)
				}
				this.newTaskId = res.data.id
				this.invitationOrder(this.isSelect)
				if (this.bond != 0) {
					setTimeout(() => {
						// uni.redirectTo({
						// 	url: '/pages/app-employer/send-job-pay/send-job-pay?taskId=' + res.data
						// 		.id
						// })
						if (!this.wdfb) {
							// this.isShowPay = true
							console.log('sadxasdsa')
							uni.redirectTo({
								url: '/pages/app-employer/fabu-pay/fabu-pay?taskId=' + this.newTaskId
							})
						} else {
							uni.redirectTo({
								url: '/pages/my-job/boss-my-job-new'
							})
						}
					}, 300)
				} else {
					// console.log('保证金没')
					this.payBondZero(res.data.id)
					setTimeout(() => {
						uni.redirectTo({
							url: '/pages/my-job/boss-my-job-new'
						})
					}, 300)
				}
			},
			//功能监测---一键发布1任务中心发布/2历史发布3是完单邀请4是重新发单
			async get_task_one(type) {
				let v = {
					'type': type
				}
				let res = await this.$fetch(this.$api.get_task_one, v, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
			},
			// 不用支付保证金时，默认调付保证金接口
			async payBondZero(id) {
				let bondObj = {
					payPwd: '',
					payType: -1, //0支付宝，1微信，2钱包，-1,保证金为0
					taskId: id,
				}
				let res = await this.$fetch(this.$api.v1_pay_bond, bondObj, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
			},
			// 获取任务详情
			async task_detail() {
				let res = await this.$fetch(this.$api.task_detail, {
					taskId: this.taskId
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.task.address = res.data.address
				this.task.lat = res.data.lat
				this.task.lng = res.data.lng
				this.task.name = res.data.name
				this.task.number = res.data.number > this.task.number ? res.data.number : this.task.number
				this.task.region = res.data.region
				this.task.reward = res.data.reward.divide(100)
				this.task.sex = res.data.sex.toString()
				this.task.taskContent = res.data.taskContent
				this.task.taskPic = res.data.taskPic
				this.pictureList = res.data.taskPic ? res.data.taskPic.split(',') : []
				this.task.taskType = res.data.taskType.toString()
				this.task.floorsAmount = res.data.floorsAmount.divide(100)
				this.task.taskVideo = res.data.taskVideo
				this.task.telephone = res.data.telephone
				this.task.age = res.data.age
				this.task.startTime = this.getDate(res.data.startTime)
				this.task.endTime = this.getDate(res.data.endTime)
				this.task.floorsstr = res.data.floorsstr
				this.isTaskTomorrowFlag = isTaskTomorrow(this.task.startTime, this.task.endTime)
				this.task.disturbstatus = res.data.disturbstatus
				// this.task.taskCateName = res.data.taskCateName
				// this.task.taskCateId = res.data.taskCateId
			},
			//点击计算人数
			addNumber(flag) {
				if (flag) {
					if (this.task.number >= 99) {
						this.task.number = 99
						uni.showToast({
							title: '人数不能再多了~',
							icon: 'none'
						})
						return
					}
					this.task.number++
				} else {
					if (this.task.number <= this.taskNum) {
						uni.showToast({
							title: '人数不能在少了~',
							icon: 'none'
						})
						return
					}
					this.task.number--
				}
			},
			//输入人数
			inputNumber() {
				clearTimeout(this.timer)
				this.timer = setTimeout(() => {
					if (this.task.number < 1) {
						this.task.number = 1
						uni.showToast({
							title: '人数不能在少了~',
							icon: 'none'
						})
						return
					}
				}, 800)
			},
			redact() {
				this.setStorageStaff()
				if (this.wdfb) {
					uni.navigateTo({
						url: '/pages/app-employer/send-job/send-job?taskId=' + this.taskId + '&type=new' +
							'&minNumber=' + this.task.number + '&wdfb=1' + '&source=' + this.pageType
					})
				} else {
					uni.navigateTo({
						url: '/pages/app-employer/send-job/send-job?taskId=' + this.taskId + '&type=new' +
							'&minNumber=' + this.task.number + '&source=' + this.pageType
					})
				}
			},
			// 发布任务时 缴纳保证金配置(元/人)
			async getBond() {
				let res = await this.$fetch(this.$api.property_list_by_type, {
					type: 1
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				uni.setStorageSync('bond', res.data.bond)
				if (res.data.Release_notes != "") {
					this.truexianshi = "block"
					this.textlie = res.data.Release_notes
				}
				this.bond = res.data.bond
				//this.piece_tip = res.data.piece_tip
				//this.time_lowest_amount = res.data.time_lowest_amount
				//console.log('计时最低时薪', time_lowest_amount)
			},
			//接收开始时间
			starTime(v) {
				this.task.startTime = v
			},
			//接收结束时间
			endTime(v) {
				this.task.endTime = v
			},
			//接收任务时间
			getTaskTime(timeList) {
				this.task.startTime = timeList[0]
				this.task.endTime = timeList[1]
				this.isShowTimeSelect = false
				this.isTaskTomorrowFlag = isTaskTomorrow(timeList[0], timeList[1])
			},
			showFirst() {
				this.isfirst++
				if (this.isfirst == 2) {
					uni.setStorageSync('quickSendJob', this.isfirst)
				}
			},
			isclosePullToRefresh(flag) {
				const pages = getCurrentPages();
				const page = pages[pages.length - 1];
				const currentWebview = page.$getAppWebview();
				currentWebview.setStyle({
					pullToRefresh: {
						support: flag,
						style: plus.os.name === 'Android' ? 'circle' : 'default'
					}
				});
			},
			// 获取当前用户信息，及服务标识
			async getUserInfo() {
				let res = await this.$fetch(this.$api.get_current_user, {}, 'GET')
				// if (res.code) return uni.showToast({
				// 	title: res.msg,
				// 	icon: 'none'
				// })
				if (res.code === 531) {
					uni.navigateTo({
						url: '/pages/riskControl/riskControl',
					})
					return
				}
				// if (res.data.idCardStatus != 2 && res.data.issuanceNum > 0) {
				// 	uni.showModal({
				// 		title: '尊敬的找零工用户',
				// 		content: '您的任务已达上限，请先去实名后发布零工!',
				// 		cancelText: '去实名',
				// 		confirmText: '取消',
				// 		success: (res) => {
				// 			if (res.cancel) {
				// 				uni.navigateTo({
				// 					url: '/pages/real-name/real-name'
				// 				})
				// 			} else {
				// 				console.log('取消')
				// 			}
				// 		}
				// 	})
				// }
				if (res.data.payPwdFlag) {
					uni.setStorageSync('isHavePayPassword', true)
				} else {
					uni.setStorageSync('isHavePayPassword', false)
				}
				this.ykCount = res.data.cardNumber
				this.ykName = res.data.cardUserType == 1 ? '月卡' : res.data.cardUserType == 2 ? '半年卡' : res.data
					.cardUserType == 3 ? '年卡' : res.data.cardUserType == 0 ? '0' : '体验卡'
				uni.setStorageSync('userInfo', res.data)
				uni.setStorageSync('userType', res.data.userType)
				uni.setStorageSync("level", res.data.user.level) //用户等级
				this.isLevelsd = res.data.user.level
			},
			goToBuyJiayou() {
				uni.navigateTo({
					url: '/pages/bossMonthCard/straightCard'
				})
			},
			async getIsYouxian() {
				let res = await this.$fetch(this.$api.property_list_by_type_and_key, {
					type: 1,
					key: 'task_release_user_flag'
				}, 'POST')
				console.log(res, 'getIsYouxian')
				if (res.code != 0) {
					return
				}
				if (Number(res.data) == 4) {
					this.isOpenYouxian = true
					this.isYouxian = true
				} else {
					if (uni.getStorageSync('userInfo').cardUserType == Number(res.data)) {
						this.isOpenYouxian = true
						this.isYouxian = true
					}
				}
			}
		},
		onLoad(value) {
			// #ifdef APP-PLUS
			if (uni.getStorageSync('token')) {
				setTimeout(() => {
					getContacts()
				}, 1000)
			}
			// #endif
			if (value.wdfb == 1) {
				this.wdfb = true
			}
			this.pageType = value.page
			if (value.people == 0) {
				this.task.number = 1
			} else {
				//this.BackPress = true
				this.task.number = value.people
				this.taskNum = value.people
			}
			this.imgPath = uni.getStorageSync('imgPath')
			this.timeFlag = parseInt(value.timeFlag)
			this.taskId = value.taskId
			this.refresh()
			if (uni.getStorageSync('quickSendJob') == 2) {
				this.isfirst = uni.getStorageSync('quickSendJob')
			}
			this.qipao()
			this.getIsYouxian()
		},
		updated() {
			if (this.isfirst >= 2) {
				this.isTaskDateRational()
			}
		},
		onShow() {
			this.md5flag = md5.hex_md5((Date.now() + uni.getStorageSync('token'))).toString()
			this.getBond()
			this.isBtnClick = false
		},
		onPullDownRefresh() {
			this.refresh()
		},
		onBackPress(e) {
			if (this.BackPress) {
				this.isShowModalButton = true
				this.BackPress = false
				return true
			}
			if (this.isShowModalButton) {
				return true
			}
		},
		onShareAppMessage() {
			if (uni.getStorageSync('userType') == 1) {
				return {
					title: "足不出户，免费招工",
					desc: "线上招募零工，工价透明，免费使用",
					path: `/pages/start-n/start-n`,
					imageUrl: 'https://images.linglinggong.net/static/employer-share.jpg',
					success: res => {}
				}
			} else {
				return {
					title: "在家找日结兼职，工种齐全",
					desc: "免费使用，提前在家找日结兼职",
					path: `/pages/start-n/start-n`,
					imageUrl: 'https://images.linglinggong.net/static/employee-share.jpg',
					success: res => {}
				}
			}
		},
	}
</script>
<style lang="less" scoped>
	.container {
		background-color: #F2F2F2;
	}

	.container-bg {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.headBg {
		width: 750rpx;
		height: calc(176rpx + var(--status-bar-height));
		background-color: #FCC928;
		display: flex;
		justify-content: center;
	}

	.headBg::after {
		content: '';
		position: absolute;
		width: 750rpx;
		height: 128rpx;
		top: calc(112rpx + var(--status-bar-height));
		border-radius: 100%;
		background-color: #FCC928;
	}

	.head {
		width: 634rpx;
		height: 88rpx;
		margin-top: calc(-176rpx + var(--status-bar-height));
		display: flex;
		align-items: center;
		z-index: 10;

		&>text {
			width: 588rpx;
			height: 80rpx;
			font-size: 36rpx;
			font-weight: bold;
			color: #000000;
			line-height: 36rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.fanhuiIma {
			width: 23rpx;
			height: 40rpx;
		}
	}

	.marginTop20 {
		margin-top: 20rpx;
	}

	.taskInfo {
		width: 690rpx;
		height: 588rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 30rpx 0px rgba(0, 0, 0, 0.04);
		border-radius: 12rpx;
		margin-top: 12rpx;
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.taskAdd {
		width: 690rpx;
		height: 173rpx;
		background-color: #FFFFFF;
		box-shadow: 0px 0px 30rpx 0px rgba(0, 0, 0, 0.04);
		border-radius: 12rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		.marginTop20;
	}

	.taskInfoPs {
		width: 690rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 30rpx 0px rgba(0, 0, 0, 0.04);
		border-radius: 12rpx;
		.marginTop20;
	}

	.taskInfo-tile {
		height: 122rpx;
		width: 660rpx;
		margin-left: 30rpx;
		display: flex;
		align-items: center;
	}

	.taskInfo-yellowBlock {
		width: 8rpx;
		height: 38rpx;
		background: #FCC928;
		border-radius: 4rpx;
	}

	.taskInfo-tile-text {
		font-size: 40rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #000000;
		line-height: 45rpx;
		margin-left: 16rpx;
	}

	.taskInfo-item {
		width: 690rpx;
		height: 303rpx;
		background: #F9F9F9;
		display: flex;
		align-items: center;
		flex-direction: column;
	}

	.taskInfo-price {
		width: 630rpx;
		height: 150rpx;
		border-bottom: 1rpx dashed #D5D5D5;
	}

	.taskInfo-price-item {
		width: 630rpx;
		height: 79rpx;
	}

	.taskInfo-item-textDive1 {
		display: flex;
		justify-content: space-between;
		margin-top: 36rpx;
	}

	.taskInfo-item-textDive2 {
		display: flex;
		justify-content: space-between;
		margin-top: 28rpx;
	}

	.taskInfo-item-text1 {
		font-size: 24rpx;
		font-weight: 500;
		color: #7F7F7F;
		line-height: 24rpx;
	}

	.taskInfo-item-text2 {
		font-size: 30rpx;
		font-weight: bold;
		color: #000000;
		line-height: 30rpx;
	}

	.taskInfo-time {
		width: 630rpx;
		height: 150rpx;
	}

	.taskInfo-time-item {
		width: 630rpx;
		height: 79rpx;
	}

	.taskInfo-people {
		width: 690rpx;
		height: 162rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.maskRemove {
		width: 322rpx;
		height: 162rpx;
		border-radius: 12rpx;
		background-color: #FFF;
	}

	.maskRemoveLife_text {
		margin-left: 30rpx;
		margin-top: 36rpx;
	}

	.maskRemoveLife_text2 {
		margin-left: 30rpx;
		margin-top: 28rpx;
	}

	.maskRemoveRight_text {
		margin-right: 30rpx;
		margin-top: 36rpx;
		display: flex;
		justify-content: flex-end;
	}

	.maskRemoveRight_text2 {
		margin-right: 30rpx;
		margin-top: 28rpx;
	}

	.renshu {
		display: flex;
		justify-content: flex-end;
		align-items: center;

		&>image {
			height: 24rpx;
			width: 24rpx;
		}

		&>input {
			font-size: 36rpx;
			font-weight: bold;
			color: #000000;
			line-height: 36rpx;
			text-align: center;
			width: 112rpx;
		}
	}

	.taskAddInfo {
		width: 628rpx;
		height: 77rpx;
		font-size: 28rpx;
		font-weight: 500;
		color: #000000;
		line-height: 50rpx;
		display: inline-table;
	}

	.bottomButton {
		position: fixed;
		bottom: 0;
		width: 750rxp;
		height: 98rpx;
		display: flex;
		justify-content: space-between;
	}

	.buttonCenter {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.bottomButton1 {
		width: 375rpx;
		height: 98rpx;
		background: #FFFFFF;
		font-size: 32rpx;
		font-weight: bold;
		color: #000000;
		line-height: 45rpx;
		.buttonCenter
	}

	.bottomButton2 {
		width: 375rpx;
		height: 98rpx;
		background: #FCC928;
		font-size: 32rpx;
		font-weight: bold;
		color: #402110;
		line-height: 45rpx;
		.buttonCenter
	}

	.bottomButton3 {
		width: 375rpx;
		height: 98rpx;
		background: #ABABAB;
		font-size: 32rpx;
		font-weight: bold;
		color: #000000;
		line-height: 45rpx;
		.buttonCenter
	}

	.taskInfoPs-text {
		margin: 48rpx 32rpx 24rpx 32rpx;
		font-size: 28rpx;
		font-weight: 500;
		color: #000000;
		line-height: 50rpx;
	}

	.taskInfoPs-picture-div {
		width: 690rpx;
		height: 140;
		display: flex;
	}

	.taskInfoPs-picture {
		width: 140rpx;
		height: 140rpx;
		border-radius: 4rpx;
		margin-right: 21rpx;
		margin-bottom: 48rpx;
	}

	.taskInfoPs-video {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 140rpx;
		height: 140rpx;
		border-radius: 4rpx;
		margin-right: 21rpx;
		margin-bottom: 48rpx;
		background-color: #000000;
	}

	.taskInfoPs-video-playIcon {
		width: 45rpx;
		height: 45rpx;
	}

	.maskFirst {
		width: 100vw;
		height: 100vh;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 20;
		background-color: rgba(0, 0, 0, 0.5);
	}

	.maskRemove-indicator {
		position: relative;
		top: 30rpx;
		width: 322rpx;
		height: 104rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
	}

	.maskRemove-indicator-sj {
		width: 0rpx;
		height: 0rpx;
		border-left: 16rpx solid transparent;
		border-right: 16rpx solid transparent;
		border-bottom: 34rpx solid #FDC928;
	}

	.maskRemove-indicator-block {
		width: 322rpx;
		height: 88rpx;
		background: #FDC928;
		border-radius: 12px;
		font-size: 26rpx;
		font-weight: 500;
		color: #4F3212;
		line-height: 50rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.yk_count {
		padding: 0 10rpx;
		height: 28rpx;
		background: linear-gradient(45deg, #FF5628, #FF231C);
		border-radius: 4rpx;
		font-size: 16rpx;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 28rpx;
		text-align: center;
	}

	.yk_count_sj {
		margin: 0 -14rpx 0 -1rpx;
		border-top: 14rpx solid transparent;
		border-right: 14rpx solid transparent;
		border-left: 14rpx solid #FF231C;
		border-bottom: 14rpx solid transparent;
	}

	.miandarao {
		margin-top: 20rpx;
		width: 690rpx;
		height: 176rpx;
		background: #FFFFFF;
		box-shadow: 0px 0px 30rpx 0px rgba(0, 0, 0, 0.04);
		border-radius: 12rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.miandarao-info {
		margin: 0rpx 0 0 30rpx;
		display: flex;
		flex-direction: column;

		&>text:nth-child(1) {
			font-size: 32rpx;
			font-weight: bold;
			color: #402110;
			line-height: 50rpx;
		}

		&>text:nth-child(2) {
			font-size: 28rpx;
			font-weight: 400;
			color: #402110;
			line-height: 50rpx;
		}
	}

	.miandarao-button {
		width: 88rpx;
		height: 48rpx;
		background: #B5B5B5;
		border-radius: 24rpx;
		margin-right: 30rpx;
	}

	.miandarao-button-switch {
		width: 40rpx;
		height: 40rpx;
		background: #FFFFFF;
		border-radius: 50%;
		position: relative;
		margin: 4rpx;
	}

	.miandarao-button-selected {
		transform: rotate(180deg);
		background: #FCC928 !important;
	}

	.youxian-content {
		width: 100%;

		.youxian {
			margin-top: 40rpx;
			text-align: left;
			padding-left: 30rpx;
			width: 100%;
			color: #333333;
			font-weight: bold;
			display: flex;
			align-items: center;

			.radio {
				width: 32rpx;
				height: 32rpx;
				border-radius: 6rpx;
				border: 2rpx solid #979797;
				margin-right: 20rpx;
				box-sizing: border-box;
			}

			image {
				width: 32rpx;
				height: 32rpx;
				margin-right: 20rpx;
			}
		}

		.sanjiao {
			border-width: 14rpx 14rpx;
			border-style: dashed dashed solid dashed;
			/*IE6下, 设置余下三条边的border-style为dashed,即可达到透明的效果*/
			border-color: transparent transparent #4c4c4c transparent;
			width: 0;
			height: 0;
			overflow: hidden;
			font-size: 0;
			/*是因为, 虽然宽高度为0, 但在IE6下会具有默认的 */
			line-height: 0;
			margin-left: 40rpx;
			// margin: 0 auto;
		}

		.youxian-qipao {
			margin-left: 30rpx;
			transition: all 0.3s;
			align-self: flex-start;
			width: 376rpx;
			height: 80rpx;
			text-align: center;
			border-radius: 10rpx;
			line-height: 80rpx;
			background-color: rgba(0, 0, 0, 0.7);
			color: #FFFFFF;
		}
	}
</style>